package com.xnew;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.web.client.RestTemplate;
import springfox.documentation.oas.annotations.EnableOpenApi;

/**
 * @Author yangchengdong
 * @Date 2020/12/22
 */

@EnableDiscoveryClient
@SpringBootApplication
@EnableAsync
@EnableOpenApi
@EnableFeignClients
@EnableCaching
@MapperScan("com.xnew.*.mapper")
public class MemberSecurityApplication {

	public static void main(String[] args) {
		SpringApplication.run(MemberSecurityApplication.class, args);
	}

	@Bean
	@LoadBalanced // 在注册中心里进行查找微服务,负载均衡
	public RestTemplate restTemplate() {
		RestTemplate restTemplate = new RestTemplate();
		return restTemplate;
	}

}
